//
//  RootViewController.m
//  Practice_jiugongge
//
//  Created by dllo on 15/10/19.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "RootViewController.h"
#import "CustomView.h"
#import "FirstViewController.h"

@interface RootViewController ()<CustomViewDelegate>

@property (nonatomic, assign) CustomView *customV;

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    for (int i = 0; i < 9; i++) {
        self.customV = [[CustomView alloc] initWithFrame:CGRectMake(20+118*(i%3), 20+118*(i/3), 98, 98)];
        self.customV.backgroundColor = [UIColor blueColor];
        
        NSString *name = [NSString stringWithFormat:@"image%d.jpg", i+1];
        self.customV.customImageView.image = [UIImage imageNamed:name];
        [self.view addSubview:self.customV];
        [self.customV release];
        
        self.customV.cusDelegate = self;
        self.customV.customImageView.tag = 1000+i;
        
    }
    
    
    
    
    
}

-(void)present:(NSString *)string
{
    FirstViewController *first = [[FirstViewController alloc] init];
    
    first.string = string;
    

    [self presentViewController:first animated:YES completion:^{
        
        
    }];
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
